import time

from selenium import webdriver
from selenium.webdriver import Keys
from selenium.webdriver.common.by import By

driver=webdriver.Edge()
driver.maximize_window()
driver.get('file:///C:/Users/lenovo/Downloads/Frame.html')

# 进入frame
driver.switch_to.frame(driver.find_element(By.ID,'search'))

# 搜索框输入ui自动化
search=driver.find_element(By.ID,'query')
search.send_keys('UI自动化')
time.sleep(2)
search.send_keys(Keys.ENTER)

time.sleep(5)
driver.quit()
